﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CharacterCreation.Data.Models {
    [Serializable]
    public class Statistic : BasePersistanceClass {

        
        /// <summary>
        /// Gets or sets the Level
        /// </summary>
        public int Level {
            get { return _Level; }
            set {
                _Level = value;
                RaisePropertyChanged("Level");
            }
        }
        private int _Level;
                

        public virtual int CalculateStatistic(int start, int racebonus, int xp) {
            int temp = start;
            while (xp > 0) {
                if (temp < 25 && xp > 2) {
                    temp++; xp = xp - 3;
                }
                else if (temp < 31 && xp > 3) {
                    temp++; xp = xp - 4;
                }
                else if (temp < 37 && xp > 4) {
                    temp++; xp = xp - 5;
                }
                else if (temp < 43 && xp > 5) {
                    temp++; xp = xp - 5;
                }
                else
                    xp = 0;
            }
            return temp + racebonus; 
        }
                
    }
}
